package com.foton.lotterydomain.award.service.factory;

import com.foton.lotterycommon.common.Constants;
import com.foton.lotterydomain.award.service.goods.IDistributionGoods;
import com.foton.lotterydomain.award.service.goods.impl.CouponGoods;
import com.foton.lotterydomain.award.service.goods.impl.DescGoods;
import com.foton.lotterydomain.award.service.goods.impl.PhysicalGoods;
import com.foton.lotterydomain.award.service.goods.impl.RedeemCodeGoods;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author RenPu
 * @Date 2023/11/25 16:10
 * @Version 1.0
 * @Description: 发放奖品策略配置类
 **/

public class GoodsConfig {

    /**
     * 发放奖品策略 容器
     */
    protected static Map<Integer, IDistributionGoods> goodsStrategyContainer = new ConcurrentHashMap<>();

    @Resource
    private CouponGoods couponGoods;  //优惠卷
    @Resource
    private DescGoods descGoods;      //文字描述
    @Resource
    private PhysicalGoods physicalGoods; // 实物品
    @Resource
    private RedeemCodeGoods redeemCodeGoods; //兑换码

    @PostConstruct
    public void init() {
        goodsStrategyContainer.put(Constants.AwardType.CouponGoods.getCode(), couponGoods);
        goodsStrategyContainer.put(Constants.AwardType.DESC.getCode(), descGoods);
        goodsStrategyContainer.put(Constants.AwardType.PhysicalGoods.getCode(), physicalGoods);
        goodsStrategyContainer.put(Constants.AwardType.RedeemCodeGoods.getCode(), redeemCodeGoods);
    }


}
